<?php
/**
 * Created by PhpStorm.
 * User: ouryun
 * Date: 2021/5/11
 * Time: 19:11
 */

namespace app\admin\controller;


use think\admin\Controller;

/**
 * 公司信息管理
 * Class Company
 * @package app\admin\controller
 */
class Company extends Controller
{
    /**
     * 公司信息展示
     * @auth true
     * @login true
     */
    public function index()
    {
        $this->title = '公司信息';
        $this->fetch();
    }

    /**
     * 保存公司信息
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\DbException
     * @throws \think\db\exception\ModelNotFoundException
     * @auth true
     * @login true
     */
    public function save()
    {
        $data = [
            'company_name' => input('company_name'),
            'company_establish_time' => input('company_establish_time'),
            'company_desc' => input('company_desc')
        ];
        foreach ($data as $key => $value) sysconf($key, $value);
        sysoplog('公司信息', '修改公司信息成功');
        $this->success('保存成功', '');
    }
}